﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="editarAnuncio.aspx.cs" Inherits="LI4.editarAnuncio" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .style2
        {
            width: 337px;
        }
        #form1
        {
            width: 802px;
        }
        .style3
        {
            width: 247px;
            text-align: center;
        }
    </style>
    
    
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg&sensor=true_or_false"
            type="text/javascript"></script>
<script>
    var geocoder;
    var address;
    var marker;

    function initialize() {
    

        try{
          if (GBrowserIsCompatible()) {
            map = new GMap2(document.getElementById("map_canvas"));

            
            var lat = parseFloat(document.getElementById("click_lat").value);
            var lng = parseFloat(document.getElementById("click_long").value);
            var center = new GLatLng(lat, lng);
            map.setCenter(center, 13);
            marker = new GMarker(center, {draggable: false});
            map.addOverlay(marker);
            map.setUIToDefault();
            
            
          } 
          GEvent.addListener(map,"click", function(overlay, latlng) {     
          if (latlng) { 
            document.getElementById("click_lat").value = latlng.y;
            document.getElementById("click_long").value = latlng.x;
            marker.setLatLng(latlng);
            map.addOverlay(marker);
          }
            });
          
             
           /*GEvent.addListener(marker, "dragstart", function() {
          map.closeInfoWindow();
          });*/
          

       /* GEvent.addListener(marker, "dragend", function() {
          marker.openInfoWindowHtml("Just bouncing afloat...");
          document.getElementById("click_lat").value = marker.getLatLng().y;
            document.getElementById("click_float").value = marker.getLatLng().x;
           });*/
       }catch(Error){
        
       }    

    }
    


   

    </script>
    
</head>

<body onload="initialize()" onunload="GUnload()">
    <form id="form1" runat="server">
    <table style="width: 800px"><tr><td class="style3">
        Editar Anuncio<br />
        <br />
        Anuncios:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:ListBox ID="anunciosLB" runat="server" Height="89px" Width="131px">
        </asp:ListBox>
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
            Text="Ver informações" Width="110px" />
        <br />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Área:&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="areaLB" runat="server" Height="18px" Width="111px">
        </asp:DropDownList>
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br />
&nbsp;&nbsp;&nbsp;&nbsp; Distrito:&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="distritoLB" runat="server" AutoPostBack="True" 
            onselectedindexchanged="distritoLB_SelectedIndexChanged" Height="17px" 
            Width="111px">
        </asp:DropDownList>
        <br />
&nbsp;
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Localidade:&nbsp;
        <asp:DropDownList ID="localidadeLB" runat="server" Height="16px" Width="111px">
        </asp:DropDownList>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br />
        <br />
&nbsp;&nbsp; Morada:&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="ruaTB" runat="server" MaxLength="25" Width="115px"></asp:TextBox>
        <br />
        <br />
        Código Postal:&nbsp;<asp:TextBox ID="codpostal1" MaxLength="4" Width="63px" runat="server"></asp:TextBox>
&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="codpostal2" runat="server" MaxLength="3" Width="41px"></asp:TextBox>
        <br />
        Descrição:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="descricaoTB" runat="server" Height="96px" MaxLength="500" 
            TextMode="MultiLine" Width="154px"></asp:TextBox>
        <br />
        <br />
&nbsp;<asp:Button ID="Button2" runat="server" onclick="Button2_Click" 
            Text="Eliminar" style="height: 26px" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button3" runat="server" onclick="Button3_Click" 
            Text="Alterar" />
        <br />
&nbsp;

    </td>
    <td class="style2">
    <div id="map_canvas" style="height: 443px; width: 450px;" runat="server"> </div>
            
            <input type="hidden"   id="click_lat"	onclick="this.blur()" runat="server"/>&nbsp;

	        <input type="hidden"  id="click_long"	onclick="this.blur()" runat="server"/>&nbsp;
    
    
    
    </td>
    
    </tr></table>
    

    </form>
</body>
</html>
